import request from '@/utils/request';

//路由导航
export function listNavMenu() {
    return request({
        url: '/navMenu/listNavMenu',
        method: 'get'
    });
}

// 首页轮播图列表
export function listBanner() {
    return request({
        url: '/banner/listBanner',
        method: 'get'
    });
}

// 保存评论
export function saveComments(data) {
    return request({
        url: '/comments/saveComments',
        method: 'post',
        data: data
    });
}

// 首页数据
export function findOneConfigs() {
    return request({
        url: '/configs/findOneConfigs',
        method: 'get'
    });
}

// 修改导航菜单的方法
export function updateNavMenu(data) {
    return request({
        url: '/navMenu/updateNavMenu',
        method: 'post',
        data: data
    });
}

//修改配置信息
export function updateConfigs(data) {
    return request({
        url: '/configs/updateConfigs',
        method: 'post',
        data: data
    });
}

//获取所有配置信息
export function finconfigmap() {
    return request({
        url: '/configMap/list',
        method: 'get'
    })
}

//修改配置信息
export function updateConfigMap(data) {
    return request({
        url: '/configMap/updateConfigs',
        method: 'post',
        data: data
    })
}

//添加菜单
export function addMenu(data) {
    return request({
        url: '/navMenu/addNavMenu',
        method: 'post',
        data: data
    })
}
//查看留言列表
export function listComments(params = {}) {
  // return request.get('/comments/getCommentsList', { params });
    return request.get(
        `/comments/getCommentsList?pageNo=${params.pageNo}&pageSize=${params.pageSize}`
    );
}
